def print_shoppinglist():
    width = 30
    price_width = 10
    item_width = width - price_width
    
    header_format = '%-*s%*s'
    format = '%-*s%*.2f'
    
    print('='*width)
    
    #打印表头
    print(header_format %(item_width,'项目',price_width,'价格'))
    
    print('-' * width)
    
    print(format % (item_width,'苹果',price_width,6.0))
    print(format % (item_width,'桔子',price_width,3.2))
    print(format % (item_width,'香蕉',price_width,2.5))
    print(format % (item_width,'葡萄',price_width,14.8))
    print(format % (item_width,'红提',price_width,15))
    print(format % (item_width,'西瓜',price_width,1.5))
    
    print('='*width)